import 'package:flutter/material.dart';
import 'package:flutter_app/scoped_model/auth.dart';
import 'package:flutter_app/utils/scoped_model_helper.dart';

class BuildButtonColumn extends StatelessWidget {
  final Color? color;
  final IconData icon;
  final String label;
  final String? pushUrl;

  const BuildButtonColumn(
      {Key? key,
      this.color,
      required this.icon,
      required this.label,
      this.pushUrl})
      : super(key: key);
  @override
  Widget build(BuildContext context) {
    var isLogin = ScopedHelperModel.getModel<AuthModel>(context).isLogin;

    return InkWell(
        onTap: () {
          // if (isLogin) {
          // Navigator.pushNamed(context, pushUrl!);
          // return;
          // }
          // Navigator.pushNamed(context, '/login');

          Navigator.pushNamed(context, pushUrl!);
        },
        child: Column(
          mainAxisSize: MainAxisSize.min,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Icon(icon, color: color),
            Container(
              margin: const EdgeInsets.only(top: 8),
              child: Padding(
                padding: const EdgeInsets.only(bottom: 10),
                child: Text(
                  label,
                  style: const TextStyle(
                    fontWeight: FontWeight.w400,
                  ),
                ),
              ),
            ),
          ],
        ));
  }
}
